package skipass;

import java.util.Iterator;

import skipass.container.Card;

import mycollections.MyMap;

public class Main {

	public static void main(String[] args) {
		CardStatSystem statSystem = new CardStatSystem();
		TurnStile turnStile = new TurnStile(statSystem);
		Card pass10 = statSystem.createCard(CardType.PASS10);
		Card halfDay = statSystem.createCard(CardType.FIRSTHALFDAY);
		Card season = statSystem.createCard(CardType.SEASON);
		Card twoDay = statSystem.createCard(CardType.TWODAY);
		Card twoDayWeekend = statSystem.createCard(CardType.TWODAYW);		
		turnStile.checkCard(twoDay);
		turnStile.checkCard(pass10);
		turnStile.checkCard(halfDay);
		turnStile.checkCard(twoDayWeekend);
		turnStile.checkCard(season);
		Iterator<MyMap.Entry<CardType,Double>> it = statSystem.getPassPercGroupByCardType().entryIterator();
		while(it.hasNext()) {
			MyMap.Entry<CardType,Double> e = it.next();
			System.out.println("Card type: " + e.getKey() + " pass " + e.getValue() + "%");
		}
		System.out.println("Total avg pass: " + statSystem.getAvgPassPerc() + "%");		
	}

}
